﻿<!DOCTYPE html>
<html ng-app="demoApp">
<head>
    <title id='Description'>jqxWindow Directive for AngularJS.</title>
    <link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" />
    <script type="text/javascript" src="../../scripts/angular.min.js"></script>
    <script type="text/javascript" src="../../scripts/jquery-1.11.1.min.js"></script>
    <script type="text/javascript" src="../../scripts/demos.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxbuttons.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxwindow.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxscrollbar.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxangular.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxpanel.js"></script>
    <script type="text/javascript">
        var demoApp = angular.module("demoApp", ["jqwidgets"]);
        demoApp.controller("demoController", function ($scope) {
            $scope.jqxWindowSettings = {
                maxHeight: 150, maxWidth: 280, minHeight: 30, minWidth: 250, height: 145, width: 270,
                resizable: false, isModal: true, autoOpen: false, modalOpacity: 0.3
            };

            // show button click handler.
            $scope.showWindow = function () {
                $scope.jqxWindowSettings.apply('open');
            }

            // Ok button click handler.
            $scope.Ok = function () {
                $scope.jqxWindowSettings.apply('close');
            }

            // cancel button click handler.
            $scope.Cancel = function () {
                $scope.jqxWindowSettings.apply('close');
            }
        });
    </script>
</head>
<body class='default'>
    <div ng-controller="demoController">
        <jqx-window jqx-settings="jqxWindowSettings">
            <div>
                Modal Window
            </div>
            <div>
                <div>
                        Please click "OK", "Cancel" or the close button to close the modal window. The dialog
                        result will be displayed in the events log.
                    </div>
                    <div>
                    <div style="float: right; margin-top: 15px;">
                        <jqx-button jqx-on-click="Ok()" style="margin-right: 10px">Ok</jqx-button>
                        <jqx-button jqx-on-click="Cancel()">Cancel</jqx-button>
                    </div>
                    </div>
            </div>
        </jqx-window>
        <jqx-button jqx-on-click="showWindow()">Show Window</jqx-button>
    </div>
</body>
</html>
